@inherits LayoutComponentBase
@inject NavigationManager _navigationManager

<header class="esh-app-header @(IsRootPage() ? "esh-app-header--expanded" : "")">
    <div class="esh-app-header-promo">
        <span class="esh-app-header-promo-title">All SUITS</span>
        <span class="esh-app-header-promo-subtitle">On sale this weekend</span>
    </div>
    <div class="container">
        <article class="d-flex align-content-center justify-content-between">

            <section>
                <a href="/" class="esh-app-header-logo">
                    <img class="esh-app-header-brand" src="images/logo_color.svg" />
                </a>
            </section>

            <section class="d-flex align-content-center justify-content-between">
                <Identity></Identity>
                <AuthorizeView>
                    <Authorized>
                        <BasketStatus></BasketStatus>
                    </Authorized>
                </AuthorizeView>
            </section>
        </article>
    </div>
</header>

<BasketLoader></BasketLoader>

<NotificationSubscriber>
    <Toast />
    <div class="esh-app-content">
        @Body
    </div>
</NotificationSubscriber>

<footer class="esh-app-footer">
    <div class="container">
        <article class="d-flex w-100 h-100 justify-content-between align-items-center">

            <section>
                <img class="esh-app-footer-brand" src="images/logo.svg" />
            </section>

            <section>
                © eShopOnDapr. All rights reserved
            </section>

        </article>
    </div>
</footer>

@code {

    private bool IsRootPage()
        => _navigationManager.ToBaseRelativePath(_navigationManager.Uri).Length == 0;
}  